﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;


/// <summary>
/// Summary description for FOConstants
/// </summary>
public class FOConstants
{
  public static int US_ADMIN = 1;
  public static int US_APPROVER = 2;
  public static int US_EDITOR = 3;
  public static int US_AUTHOR = 4;
  public static int US_READER = 5;

  public static string FILENAME_CKID = "Files/ckid_latest.txt";

  public static string PaddingBottom = " style=\"padding-bottom:50px;\"";
  public const string QSP_VN = "vn";
  public const string QSP_MCID = "mcid";
  public const string QSP_SCID = "scid";
  public const string QSP_CKID = "ckid";
  public const string QSP_AID = "aid";
  public const string QSP_FY = "fy";
  public const string QSP_FS = "fs";
  public const string QSP_SEARCH = "search";
  public const string QSP_QUESTION = "title";
  public const string QSP_QID = "qid";
  public const string QSP_RQSURVEY = "rqsurvey";
  public const string QSP_PAGING = "cp";

  public const string Page_ThoiTrang = "thoi trang";
  public const string Page_TrangSuc = "trang suc";
  public const string Page_LamDep = "lam dep";
  public const string Page_DetMay = "det may";
  public const string Page_Shopping = "shop thoi trang";

  public const string Page_ThoiGioiSao = "nguoi dep";
  public const string Page_GiaiTri = "giai tri";
  public const string Page_GocBanDoc = "goc ban doc";
  public const string Page_Home = "home";


  public const string Dir_ImgArticle = "hinh-anh-nguoi-mau/";
  public const string Dir_ImgTitle = "hinh-thoi-trang/";

  public const string PAGE_ReportSurvey = "reportsurvey.aspx";

  public const byte LstStandar = 0;
  public const byte LstImgText = 1;
  public const byte LstAvatar = 2;

  public const int MaxLength = 250;
  public const int ItemCharCount = 45;

  public const int ExpireCache = 8;
  public const int SessionTimeout = 60; //minute
  /// <summary>
  /// badpaybad CONVERT(DATETIME, 'yyyy-MM-dd HH:mm:ss', 102)'
  /// </summary>
  public const string DBDateTimeFormat = "yyyy-MM-dd HH:mm:ss";

  public FOConstants()
  {
    //
    // TODO: Add constructor logic here
    //
  }
  public static string GetPadding()
  {
    return PaddingBottom;
  }
  public static void SetPadding(string body)
  {
    if (body == null || body.Length == 0)
    {
      PaddingBottom = " style=\"padding-bottom:80px;\"";
      return;
    }
    int length = body.Length;
    if (length < 50)
      PaddingBottom = " style=\"padding-bottom:80px;\"";
    else if (length < 150)
      PaddingBottom = " style=\"padding-bottom:120px;\"";
    else if (length < 350)
      PaddingBottom = " style=\"padding-bottom:130px;\"";
    else if (length < 450)
      PaddingBottom = " style=\"padding-bottom:140px;\"";
    else if (length < 550)
      PaddingBottom = " style=\"padding-bottom:165px;\"";
    else if (length < 700)
      PaddingBottom = " style=\"padding-bottom:170px;\"";
    else if (length < 850)
      PaddingBottom = " style=\"padding-bottom:175px;\"";
    else if (length < 1000)
      PaddingBottom = " style=\"padding-bottom:190px;\"";
    else if (length < 1310)
      PaddingBottom = " style=\"padding-bottom:210px;\"";
    else
      PaddingBottom = " style=\"padding-bottom:230px;\"";
  }
}
